#!/bin/sh

# ipcheck.sh
# wiSync
#
# Created by Youssef Francis on 12/9/07.
# Copyright 2007 iFrancis Development Team. All rights reserved.


IP0=`ifconfig en0 | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | grep -v "ifconfig: interface en0 does not exist" | awk '{ print $2}'`
IP1=`ifconfig en1 | grep -E 'inet.[0-9]' | grep -v '127.0.0.1' | grep -v "ifconfig: interface en1 does not exist" | awk '{ print $2}'`

if [ "$IP1" == "" ]
then
echo $IP0
else
echo $IP1
fi
